#pragma once

#include "xict_common/perception/common/calibrator.h"
#include "xict_common/perception/common/config.h"
#include "xict_common/perception/plugin/yololayer.h"
#include <NvInfer.h>
#include <cassert>
#include <cmath>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <string>

namespace xict_common {
    namespace perception {
        namespace common {
            nvinfer1::ICudaEngine* BuildDetEngine(
                unsigned int maxBatchSize, nvinfer1::IBuilder* builder,
                nvinfer1::IBuilderConfig* config, nvinfer1::DataType dt,
                float& gd, float& gw, std::string& wts_name);

            nvinfer1::ICudaEngine* BuildDetP6Engine(
                unsigned int maxBatchSize, nvinfer1::IBuilder* builder,
                nvinfer1::IBuilderConfig* config, nvinfer1::DataType dt,
                float& gd, float& gw, std::string& wts_name);

            nvinfer1::ICudaEngine* BuildClsEngine(
                unsigned int maxBatchSize, nvinfer1::IBuilder* builder,
                nvinfer1::IBuilderConfig* config, nvinfer1::DataType dt,
                float& gd, float& gw, std::string& wts_name);

            nvinfer1::ICudaEngine* BuildSegEngine(
                unsigned int maxBatchSize, nvinfer1::IBuilder* builder,
                nvinfer1::IBuilderConfig* config, nvinfer1::DataType dt,
                float& gd, float& gw, std::string& wts_name);
        }   // namespace common
    }       // namespace perception
}   // namespace xict_common